package br.ufc.great.client;

import java.io.Serializable;

public class DTXResult implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4921070344620662598L;
	private String transactionId;
	private String[] results;
	private int status = NONE;
	
	public static final int NONE = 0;
	public static final int COMMITED = 1;
	public static final int ABORTED = 2;
	
	public DTXResult(String transactionId, String[] results) {
		this.transactionId = transactionId;
		this.results = results;
	}

	public String getTransactionId() {
		return transactionId;
	}

	public String[] getResults() {
		return results;
	}

	public String getResult(int index) {
		if (results == null || index >= results.length)
			return null;
		return results[index];
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	
}
